<?php

namespace App\Http\Controllers\Api;

use App\Models\Renting;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class UserController extends Controller
{
    public function  userinfo(Request $request){
        //获取openid
        $openid = $request->input('openid');
        $data = $request->only('nickname','avatar');
        $re = Renting::update(["openid"=>$openid],$data);
        if($re){
            return  $this->reSuJson('修改成功！');
        }else{
            return  $this->reErJson('账号和密码不正确！');
        }
    }
}
